package com.xiaoxi.commandmode.command;

import com.xiaoxi.commandmode.drawer.Drawable;

import java.awt.*;

/**
 * @Author xiaoxi
 * @ProjectName design_mode
 * @PackageName com.xiaoxi.commandmode.command
 * @ClassName DrawCommand
 * @Description TODO
 * @Date 2023/4/15 11:10
 * @Version 1.0
 */
public class DrawCommand implements Command {

    private Drawable drawable;

    private Point point;

    public DrawCommand(Drawable drawable, Point point) {
        this.drawable = drawable;
        this.point = point;
    }

    @Override
    public void execute() {
        drawable.draw(point.x, point.y);
    }
}
